LtU Forum, Site Discussion

ML without GC

I'm in the mood to develop an ML like language for small microcontrollers :-)

I tried to find out which subset of an ML like language do not need a garbage collector (without much success).
Do you have some ideas or some pointers to papers?

Thanks in advance!

[Fun, crass] The Daily WTF

If LtU is the zenith of PL discussion, the nadir might be The Daily WTF (where Whiskey Tango Foxtrot decodes from the phonetic alphabet to a vulgar interrogative).
If you would find refreshment in a "Bevis and Butthead to Code" kind of website, it's good for an occasional belly-laugh.

A software engineering problem: how would functional programming solve it?

Here is a simple software engineering problem that I have encountered the last few days. It's not something dramatic, but one that has made me stop development in search of elegant solutions. I am posting this here because I would like to see how functional programming languages would solve this problem.

Here is the problem: I am writing a GUI toolkit that reuses the Win32 API wrapped up in a set of C++ classes (the reason is that there is no GUI library that completely hides Win32 will reusing it - existing libraries either follow Win32 logic (ala WxWidgets) or provide their own implementation (ala Qt/Swing)). As you may know, Win32 is not object-oriented, nor does it have a well thought out/consistent interface. For example, although the menu bar is a screen object, it is not a window: all there is is a bunch of functions for creating a menu, redrawing it, adding menu items etc. But I want to have menus and other non-window Win32 items as widgets in the toolkit, for consistency reasons.

The problem lies in the organization of classes. I have 4 types of widgets:

  1. widgets with no children and no window: for example, menu items
  2. widgets with no children and window: for example, buttons
  3. widgets with children and no window: for example, menus (which have menu items as children)
  4. widgets with children and window: for example, forms

The object-oriented design solutions would be:

  1. make non-window classes unrelated to widgets; something I don't desire as it is a non-consistent solution (after all, a menu IS a widget)
  2. make a generic Widget class that has children and all window properties and ignore those properties for non-window widgets; a nasty solution.
  3. have 5 separate classes: Component, Container (extends Component), Window (extends Component), WindowedComponent (extends Component, Window), WindowedContainer (extends Container, Window), using multiple virtual inheritance or aggregation. I also don't like this solution because of namespace pollution and because it will be seen as complex by the library's users.
  4. have 3 separate classes: Component, Container (extends Component), and template class Window that can be parameterized by the type of superclass (Container or Component). I also don't like this solution, because a) templates are slow in compilation, b) bloat the size of code, c) all code has to be in the header file.

So what I am asking is how functional programming languages solve an issue like the above, which is an issue of code organization/clarity/reuse/taxonomy. I can't seem to find a good object-oriented solution to the problem, nor any of my colleagues/friends can. So I am asking if other programming paradigms have a better solution for this problem.

4-color theorem

The only correct, simple and elegant proof of
the
4-color theorem

The 4-color theorem is a well-known math problem
with
no readable proof. Spending years I finished a
correct, simple and elegant proof of it. If you read
it you will think it's the only one we can have. I
first sent my paper, not well written, to some
journals. May be 1 year later, the editors said they
did not accept it. Then I revised it and it is
simple
and elegant now, but the editors said "we do not
have
the refereeing resources to have all such papers
assessed properly." In fact they have already known
the contents of my submission. They are reluctant to
see such proof different from the old arithmetic one
to be published. Please tell me how to do with it.
Is
there anywhere to submit correct proof paper? I will
let the person read it if who promise paying for no
flaw found.

Sincerely
Cui Shitai
cuishitai12000@yahoo.com.cn

Dear Dr. Cui Shitai:
We receive a number of papers every year claiming to
present solutions to famous unsolved problems or to
give simple proofs of well-known theorems. In
particular, we receive a number of submissions on
the
four-color theorem. Unfortunately, we do not have
the
refereeing resources to have all such papers
assessed
properly. In view of this, we cannot offer you
encouraging words and we are unable to accept your
paper for publication.

Thank you for considering the Journal.

Yours sincerely,

Nick Wormald
Editor in Chief
Canada Research Chair in Combinatorics and
Optimization
Dept of Combinatorics and Optimization
University of Waterloo
Waterloo ON
CANADA N2L 3G1
Phone: (519) 885-1211
Fax: (519) 725-5441

Dear professor
I have a proof for 4-color theorem 5 pages long. I
cannot to find a journal to consider it.
Can you give me any advice? It has submitted to
annals
of mathematics, not accepted but they
didn't tell the reason.
Thank you very much
Sincerely yours,
Cui Shitai

Software Re-engineering Techniques and Reverse Engineering of Object-oriented Code ( Java language)

I am working on this ....

1- Sofwtare Re-engineering Techniques
2- Reverse Engineering of object-oriented Code ( Java )
3- Decompiler Theory
4- History of DEcompiler
5- Decompiliation process
6- Decompiler Applications
7- Java Decompiler ( Programming Phase)

THanks

Type and Effects systems and Lucassen's Thesis

I'm chasing references for type and effect systems, from the first papers by Gifford and Lucassen. One of the references is Lucassen's PhD thesis, "Types and Effects towards the Integration of Functional and Imperative Programming", Technical Report MIT-LCS-TR-408; it has a page at MIT here. I was hoping to find this thesis in electronic format, but my searches didn't reveal nothing. I searched for the homepage of the author too, with no better results.

Does anyone know if this TR is online ?

Lazy linear algebra

Lazy Linear Algebra

I wonder if any of the LtU readers would be able to advise me about
lazy languages/libraries for LinearAlgebra.html">linear algebra (vector-matrix numerics). It
strikes me that this is an problem domain in which the lazy approach
might be able to offer significant advantages. For example, it is
often the case that one wants to obtain certain elements of a matrix
resulting from some expression (e.g. one or more rows or columns, or
some elements from some row(s) or column(s)). Linear algebra can be
computationally expensive, especially if you don't want all the
values that would be computed by a naive implementation of some
expression. The lazy approach might be particularly useful if you
don't know a priori which elements you are going to need (e.g.
if the answer you seek depends upon the properties of the matrices in
question, which you may not know until you start in on the
calculations). It is certainly true that one could hand-code this
kind of laziness, but that way lies bugs and hard work on the part of
the programmer. Further, certain matrix operations yield matrices
with properties that could be lazily exploited (e.g. symmetric
matrices may be specified by only the upper or lower triangle),
yielding potential time and space savings. I realise that libraries
such as LAPACK contain
functions that exploit the properties of the matrices, but I
understand that it is the programmer who decides which functions
should be called rather than the machine. As someone with no formal
PL education, can anyone tell me what if any research has been done
on lazy linear algebra and how I might start playing around in such
an area?

(posted for Chris Rose)

Kay no longer at HP

Jst so you know.

Concerning introspection and compilation.

My knowledge in the area of languages is limited, that is why I am always visiting this site. Some of the papers, and terminology are very helpful and give me many 'over-my-head' interesting reads, so to the editors and commentors you have my thanks for the education.

I don't have a detailed grasp on introspection but I feel I have enough knowledge to appreciate its practicality. My main question arises from a seperation I see, in dealing with introspection, between so-called compiled languages like C, and C++, and dynamic languages like Python and Ruby. Does a language make sacrifices to gain the ability to introspect? And if so, what kind of sacrifices does it have to make? Can a languages like C or C++ gain introspection?

Though I guess the ultimate question would be, would languages like C and C++, and in turn their programmers, gain anything substantial from introspection?

I am sorry if my question is not completely clear, so please prod me with questions if the questions need to be refined for better answers.

Regards,

MJ Stahl

The Limits of the Semantic Extensibility of Computer Programs

I'm curious if there have been studies on the limits of semantic extensibility by computer programs. I'm not entirely sure how to phrase exactly what I mean. It's kind of like "what are the limits to how much 'environmental extensibility' a computer program can have?" I imagine the answer is related to type theory, somewhere along the lines of it being limitted based on predefined type information, but I'm not quite sure where to start looking.

This type of information would be useful when building models and meta-models, to know when "architectural astronauting" (to use a Spolsky term) isn't going to get you any more real benefits, anyway.

Sorry for the confused question. The concepts are a bit confused in my mind. Which is why I brought it here, because I imagine some of you know if anyone has done work in this area.

XML feed